import { GButton } from "../../../../../com/mui/controls/GButton";
type int = number;
//class ImgBtn
    
    export  class ImgBtn /* flash.display.Sprite */
    {
        constructor(arg1: Object /* flash.display.Bitmap */, arg2: int=80, arg3: int=90, arg4: string="BattleButton")
        {
            
            this._img = arg1;
            this._width = arg2;
            this._height = arg3;
            this._styleName = arg4;
            this.createChildren();
            return;
        }

        public get enabled(): Boolean
        {
            return this._enabled;
        }

        public set enabled(arg1: Boolean)
        {
            if (this._enabled == arg1) 
            {
                return;
            }
            this._enabled = arg1;
            if (this._enabled != false) 
            {
                this.mouseEnabled = true;
                this.mouseChildren = true;
                this._btn.enabled = true;
            }
            else 
            {
                this.mouseEnabled = false;
                this.mouseChildren = false;
                this._btn.enabled = false;
            }
            return;
        }

        /* internal  */onMouseClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            this.dispatchEvent(arg1);
            return;
        }

        public get gbutton(): GButton
        {
            return this._btn;
        }

        protected createChildren(): void
        {
            this._btn = new GButton();
            this._btn.styleName = this._styleName;
            this._btn.setSize(this._width, this._height);
            this._btn.label = "";
            addChild(this._btn);
            this._btn.addEventListener(flash.events.MouseEvent.CLICK, this.onMouseClickHandler);
            if (this._img != null) 
            {
                this._img.x = (this._btn.width - this._img.width) / 2;
                this._img.y = (this._btn.height - this._img.height) / 2;
                addChild(this._img);
            }
            return;
        }

        protected /* var */_btn: GButton;

        protected /* var */_img: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_width: int;

        /* internal */ /* var */_height: int;

        /* internal */ /* var */_styleName: string;

        /* internal */ /* var */_enabled: Boolean=true;
    }
